<%@ include file="/common/taglibs.jsp"%>

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
	"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<%@ page import="
				 org.appfuse.Constants,
                 net.sf.navigator.menu.MenuRepository"%>


<html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
<head>
	<title></title>
    <link rel="stylesheet" type="text/css" media="all"
        href="<c:url value="/styles/menuExpandable.css"/>" />
    <script type="text/javascript"
        src="<c:url value="/scripts/menuExpandable.js"/>"></script>
    <link rel="stylesheet" type="text/css" media="all"
        href="<c:url value="/styles/xtree.css"/>" />
    <script type="text/javascript"
        src="<c:url value="/scripts/xtree.js"/>"></script>
    <link rel="stylesheet" type="text/css" media="all"
        href="<c:url value="/styles/global.css"/>" />
    <link rel="stylesheet" type="text/css" media="all" href="<c:url value='/styles/${appConfig["theme"]}/theme.css'/>" />
	<link rel="stylesheet" type="text/css" media="print" href="<c:url value='/styles/${appConfig["theme"]}/print.css'/>" />
    <script type="text/javascript">
        /* Function for showing and hiding elements that use 'display:none' to hide */
        function toggleDisplay(targetId) {
            if (document.getElementById) {
                target = document.getElementById(targetId);
                if (target.style.display == "none"){
                    target.style.display = "";
                } else {
                    target.style.display = "none";
                }
            }
        }
    </script>
</head>

<body>  
<div id="content">
<%
	MenuRepository repository = 
		(MenuRepository) application.getAttribute(Constants.MENU_REPOSITORY_KEY);
	pageContext.setAttribute("repository", repository);
%>

    <div class="dynamicMenu">
    <script type="text/javascript">
        <menu:useMenuDisplayer name="Velocity" config="/templates/xtree.html"
            repository="repository" permissions="rolesAdapter">
          <c:forEach var="menu" items="${repository.topMenus}">
            <menu-el:displayMenu name="${menu.name}"/>
          </c:forEach>
        </menu:useMenuDisplayer>
    </script>
    </div>
</div>

</body>
</html>

